/**
 * Copyright (c) 2019 xstgongyi.org
 * All rights reserved.
 */
package org.xstgongyi.eduaid.service;

import java.util.List;

import org.xstgongyi.eduaid.controller.StudentAidDTO;
import org.xstgongyi.eduaid.controller.StudentAidListParamDTO;
import org.xstgongyi.eduaid.dataobject.StudentAidDO;
import org.xstgongyi.eduaid.dataobject.StudentDO;

/**
 * @author oldcrane<br/>
 * @created 2019-04-24
 */
public interface StudentAidService {

	StudentAidDO getById(Integer id);

	List<StudentAidDO> listPage(StudentAidListParamDTO paramDTO);

	int countTotal(StudentAidListParamDTO paramDTO);

	void insert(StudentAidDO aid);

	void update(StudentAidDO aid);

	void updateAidTraceInfo(StudentAidDTO aidDTO);

	void insertAidForNewStudent(StudentDO student);

	// 为有过资助记录的学生，添加新学期的资助信息
	int insertAidForExistingStudent(StudentAidDTO aidDTO);

	/**
	 * 将上学期的资助信息延续到下一个学期
	 * 
	 * @param projectId
	 * @param nextSemesterId 下学期id
	 * @return 新增的资助记录数
	 */
	int extendAid(Integer projectId, Integer nextSemesterId);

	List<StudentDO> listUnextendedStudent(Integer projectId, Integer semesterId);

	int batchUpdate(int[] aidIds, String action);

}
